<?php
class Friend extends AppModel {

	var $name = 'Friend';
	var $primaryKey = 'friend_id';

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	
	var $hasOne = array(
		'Profile' => array(
			'className' => 'Profile',
			'foreignKey' => 'user_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	function addFriend($friend_id,$user_id)
	{
		$res = $this->query('INSERT INTO ' . $this->table . ' (`id` ,`user_id` ,`friend_id`) VALUES (NULL , \'' . $friend_id . '\', \'' . $user_id . '\'), (NULL , \'' . $user_id .  '\', \'' . $friend_id . '\');');
		return $res;
	}

}
?>